package com.wmh.baseservice.admin.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.List;
import java.util.Arrays;
import java.util.ArrayList;

/**
 * @author mmx generator
 * @since 2021-11-05
 */
@ApiModel(value="AdInfo对象", description="管理员-用户信息")
public class AdInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "状态")
    private String remark;

    @ApiModelProperty(value = "-1: 冻结   1: 正常   ")
    private Integer status;

    @ApiModelProperty(value = "登录时间")
    private Date loginTime;

    @ApiModelProperty(value = "创建时间")
    private Date createTime;

    @ApiModelProperty(value = "更新时间")
    private Date updateTime;

    @ApiModelProperty(value = "版本")
    @Version
    private Integer version;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "头像")
    private String avatar;

    @ApiModelProperty(value = "账号名")
    private String account;

    @ApiModelProperty(value = "密码")
    private String password;

    @ApiModelProperty(value = "角色id")
    private Long roleId;

    @ApiModelProperty(value = "盐值")
    private String salt;

    @TableField(exist = false)
    private String roleName;

    public String getRoleName() {
        return roleName;
    }

    public void setRoleName(String roleName) {
        this.roleName = roleName;
    }

    public Long getId() {
        return id;
    }

    public AdInfo setId(Long id) {
        this.id = id;
        return this;
    }
    public String getRemark() {
        return remark;
    }

    public AdInfo setRemark(String remark) {
        this.remark = remark;
        return this;
    }
    public Integer getStatus() {
        return status;
    }

    public AdInfo setStatus(Integer status) {
        this.status = status;
        return this;
    }
    public Date getLoginTime() {
        return loginTime;
    }

    public AdInfo setLoginTime(Date loginTime) {
        this.loginTime = loginTime;
        return this;
    }
    public Date getCreateTime() {
        return createTime;
    }

    public AdInfo setCreateTime(Date createTime) {
        this.createTime = createTime;
        return this;
    }
    public Date getUpdateTime() {
        return updateTime;
    }

    public AdInfo setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
        return this;
    }
    public Integer getVersion() {
        return version;
    }

    public AdInfo setVersion(Integer version) {
        this.version = version;
        return this;
    }
    public String getName() {
        return name;
    }

    public AdInfo setName(String name) {
        this.name = name;
        return this;
    }
    public String getAvatar() {
        return avatar;
    }

    public AdInfo setAvatar(String avatar) {
        this.avatar = avatar;
        return this;
    }
    public String getAccount() {
        return account;
    }

    public AdInfo setAccount(String account) {
        this.account = account;
        return this;
    }
    public String getPassword() {
        return password;
    }

    public AdInfo setPassword(String password) {
        this.password = password;
        return this;
    }
    public Long getRoleId() {
        return roleId;
    }

    public AdInfo setRoleId(Long roleId) {
        this.roleId = roleId;
        return this;
    }
    public String getSalt() {
        return salt;
    }

    public AdInfo setSalt(String salt) {
        this.salt = salt;
        return this;
    }

    public static final String ID = "id";

    public static final String REMARK = "remark";

    public static final String STATUS = "status";

    public static final String LOGIN_TIME = "login_time";

    public static final String CREATE_TIME = "create_time";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String NAME = "name";

    public static final String AVATAR = "avatar";

    public static final String ACCOUNT = "account";

    public static final String PASSWORD = "password";

    public static final String ROLE_ID = "role_id";

    public static final String SALT = "salt";

    @Override
    public String toString() {
        return "AdInfo{" +
            "id=" + id +
            ", remark=" + remark +
            ", status=" + status +
            ", loginTime=" + loginTime +
            ", createTime=" + createTime +
            ", updateTime=" + updateTime +
            ", version=" + version +
            ", name=" + name +
            ", avatar=" + avatar +
            ", account=" + account +
            ", password=" + password +
            ", roleId=" + roleId +
            ", salt=" + salt +
        "}";
    }

    public final static String[] getFields(String ...noField){
        List<String> list = new ArrayList<>(Arrays.asList(
            AdInfo.ID
            ,AdInfo.REMARK
            ,AdInfo.STATUS
            ,AdInfo.LOGIN_TIME
            ,AdInfo.CREATE_TIME
            ,AdInfo.UPDATE_TIME
            ,AdInfo.VERSION
            ,AdInfo.NAME
            ,AdInfo.AVATAR
            ,AdInfo.ACCOUNT
            ,AdInfo.PASSWORD
            ,AdInfo.ROLE_ID
            ,AdInfo.SALT
        ));
        list.removeAll(new ArrayList<>(Arrays.asList(noField)));
        return list.toArray(new String[0]);
    }
}